interface User {
  readonly id: string; // 只读修饰符不参与编译
  name: string;
  age: number;
  // readonly arr: string[]; // arr不能被修改相当于用const定义了变量
  readonly arr: readonly string[]; // arr只读，既不能修改arr，又不能对arr增删改查
}

let u: User = {
  id: "123",
  name: "ax",
  age: 12,
  arr: ["1", "2"],
};

// u.arr = [1, 2, 3];
// u.arr.push("123");

// u.id = "1212";

// 只读数组
let arr: readonly number[] = [3, 4, 5];
let arr1: ReadonlyArray<number> = [3, 4, 5];

export {};
